package edu.lambdateacher;

import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.Properties;

import org.apache.log4j.Logger;

/*
 LambdaTeacher
 Copyright (C) 2000  Kim Mason
 Copyright (C) 2014  Vitalij Zadneprovskij

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

/**
 * This class holds other classes that we want global access to. The other
 * classes are stored in this class as static fields. It's not really
 * object oriented programming
 */
public class PropertiesManager {
	
	private static Logger log = Logger.getLogger(PropertiesManager.class);
	
	/*
	 * This variable tells whether to bring up explanation dialogs which explain
	 * what the interpreter is doing. You will want to turn these off, for
	 * example, when reducing completely to normal form
	 */
	public static boolean expdlogon = true;

	/** this is a debugging flag. Change it to turn on/off debugging */
	public static final boolean debugging = false;

	/**
	 * This holds the global LambdaTeacher
	 */
	//public static AWTUserInterface lamteacher = null;
	
	public final static char LAMBDA_CHAR = '\u03bb';
	public final static String LAMBDA_STRING = "\u03bb";
	public final static BigInteger MAX_REDUCTIONS = new BigInteger("100000");

	public PropertiesManager(){
		String propertiesFileName = "/common.properties";

		Properties properties = new Properties();
		InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(propertiesFileName);

		try {
			properties.load(inputStream);
		} catch (IOException e) {
			log.error(e.getMessage());
		}
	}
	
}
